/**
 */
package js.phonegap.methods.impl;

import js.JsPackage;

import js.backbone.BackbonePackage;

import js.backbone.impl.BackbonePackageImpl;

import js.impl.JsPackageImpl;

import js.phonegap.PhonegapPackage;

import js.phonegap.impl.PhonegapPackageImpl;

import js.phonegap.methods.MethodsFactory;
import js.phonegap.methods.MethodsPackage;
import js.phonegap.methods.PhonegapMethod;
import js.phonegap.methods.addEvent;
import js.phonegap.methods.findContacts;
import js.phonegap.methods.getCurrentPosition;
import js.phonegap.methods.sendSMS;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class MethodsPackageImpl extends EPackageImpl implements MethodsPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass phonegapMethodEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass getCurrentPositionEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass findContactsEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass addEventEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass sendSMSEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see js.phonegap.methods.MethodsPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private MethodsPackageImpl() {
		super(eNS_URI, MethodsFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link MethodsPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static MethodsPackage init() {
		if (isInited) return (MethodsPackage)EPackage.Registry.INSTANCE.getEPackage(MethodsPackage.eNS_URI);

		// Obtain or create and register package
		MethodsPackageImpl theMethodsPackage = (MethodsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MethodsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MethodsPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		JsPackageImpl theJsPackage = (JsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(JsPackage.eNS_URI) instanceof JsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(JsPackage.eNS_URI) : JsPackage.eINSTANCE);
		BackbonePackageImpl theBackbonePackage = (BackbonePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(BackbonePackage.eNS_URI) instanceof BackbonePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(BackbonePackage.eNS_URI) : BackbonePackage.eINSTANCE);
		PhonegapPackageImpl thePhonegapPackage = (PhonegapPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(PhonegapPackage.eNS_URI) instanceof PhonegapPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(PhonegapPackage.eNS_URI) : PhonegapPackage.eINSTANCE);

		// Create package meta-data objects
		theMethodsPackage.createPackageContents();
		theJsPackage.createPackageContents();
		theBackbonePackage.createPackageContents();
		thePhonegapPackage.createPackageContents();

		// Initialize created meta-data
		theMethodsPackage.initializePackageContents();
		theJsPackage.initializePackageContents();
		theBackbonePackage.initializePackageContents();
		thePhonegapPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theMethodsPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(MethodsPackage.eNS_URI, theMethodsPackage);
		return theMethodsPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getPhonegapMethod() {
		return phonegapMethodEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getgetCurrentPosition() {
		return getCurrentPositionEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getgetCurrentPosition_Timeout() {
		return (EAttribute)getCurrentPositionEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getgetCurrentPosition_MaximumAge() {
		return (EAttribute)getCurrentPositionEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getgetCurrentPosition_EnableHighAccuracy() {
		return (EAttribute)getCurrentPositionEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getfindContacts() {
		return findContactsEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getfindContacts_Filter() {
		return (EAttribute)findContactsEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getfindContacts_Multiple() {
		return (EAttribute)findContactsEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getaddEvent() {
		return addEventEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getaddEvent_Title() {
		return (EAttribute)addEventEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getaddEvent_Description() {
		return (EAttribute)addEventEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getaddEvent_Location() {
		return (EAttribute)addEventEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getaddEvent_Begin() {
		return (EAttribute)addEventEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getaddEvent_End() {
		return (EAttribute)addEventEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getsendSMS() {
		return sendSMSEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getsendSMS_Phone() {
		return (EAttribute)sendSMSEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getsendSMS_Message() {
		return (EAttribute)sendSMSEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MethodsFactory getMethodsFactory() {
		return (MethodsFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		phonegapMethodEClass = createEClass(PHONEGAP_METHOD);

		getCurrentPositionEClass = createEClass(GET_CURRENT_POSITION);
		createEAttribute(getCurrentPositionEClass, GET_CURRENT_POSITION__TIMEOUT);
		createEAttribute(getCurrentPositionEClass, GET_CURRENT_POSITION__MAXIMUM_AGE);
		createEAttribute(getCurrentPositionEClass, GET_CURRENT_POSITION__ENABLE_HIGH_ACCURACY);

		findContactsEClass = createEClass(FIND_CONTACTS);
		createEAttribute(findContactsEClass, FIND_CONTACTS__FILTER);
		createEAttribute(findContactsEClass, FIND_CONTACTS__MULTIPLE);

		addEventEClass = createEClass(ADD_EVENT);
		createEAttribute(addEventEClass, ADD_EVENT__TITLE);
		createEAttribute(addEventEClass, ADD_EVENT__DESCRIPTION);
		createEAttribute(addEventEClass, ADD_EVENT__LOCATION);
		createEAttribute(addEventEClass, ADD_EVENT__BEGIN);
		createEAttribute(addEventEClass, ADD_EVENT__END);

		sendSMSEClass = createEClass(SEND_SMS);
		createEAttribute(sendSMSEClass, SEND_SMS__PHONE);
		createEAttribute(sendSMSEClass, SEND_SMS__MESSAGE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		getCurrentPositionEClass.getESuperTypes().add(this.getPhonegapMethod());
		findContactsEClass.getESuperTypes().add(this.getPhonegapMethod());
		addEventEClass.getESuperTypes().add(this.getPhonegapMethod());
		sendSMSEClass.getESuperTypes().add(this.getPhonegapMethod());

		// Initialize classes and features; add operations and parameters
		initEClass(phonegapMethodEClass, PhonegapMethod.class, "PhonegapMethod", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(getCurrentPositionEClass, getCurrentPosition.class, "getCurrentPosition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getgetCurrentPosition_Timeout(), ecorePackage.getEString(), "timeout", null, 0, 1, getCurrentPosition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getgetCurrentPosition_MaximumAge(), ecorePackage.getEString(), "maximumAge", null, 0, 1, getCurrentPosition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getgetCurrentPosition_EnableHighAccuracy(), ecorePackage.getEString(), "enableHighAccuracy", null, 0, 1, getCurrentPosition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(findContactsEClass, findContacts.class, "findContacts", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getfindContacts_Filter(), ecorePackage.getEString(), "filter", null, 0, 1, findContacts.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getfindContacts_Multiple(), ecorePackage.getEBoolean(), "multiple", null, 0, 1, findContacts.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(addEventEClass, addEvent.class, "addEvent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getaddEvent_Title(), ecorePackage.getEString(), "title", null, 0, 1, addEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getaddEvent_Description(), ecorePackage.getEString(), "description", null, 0, 1, addEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getaddEvent_Location(), ecorePackage.getEString(), "location", null, 0, 1, addEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getaddEvent_Begin(), ecorePackage.getEString(), "begin", null, 0, 1, addEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getaddEvent_End(), ecorePackage.getEString(), "end", null, 0, 1, addEvent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(sendSMSEClass, sendSMS.class, "sendSMS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getsendSMS_Phone(), ecorePackage.getEString(), "phone", null, 0, 1, sendSMS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getsendSMS_Message(), ecorePackage.getEString(), "message", null, 0, 1, sendSMS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
	}

} //MethodsPackageImpl
